package com.mobile.net;
import java.util.ArrayList;
import java.util.List;

/**
 * 
 * 
 * @author name1
 */
public class HttpReqParams
{
    
    public List<HttpParamItem> reqParams;

    public HttpReqParams()
    {
        if(reqParams != null)
        {
            reqParams.clear();
            reqParams = null;
        }
        reqParams = new ArrayList<HttpParamItem>();
    }

    public void addParam(String key, String value)
    {
        if(reqParams != null)
        {
            HttpParamItem param = new HttpParamItem();
            param.setHttpParamName(key);
            param.setHttpParamValue(value);
            reqParams.add(param);
        }
    }
    
    public void delectParam(String key)
    {
        if(reqParams != null)
        {
            for(int i = 0; i < reqParams.size(); i++)
            {
                if(reqParams.get(i).getHttpParamName().equals(key))
                {
                    reqParams.remove(i);
                }
            }
        }
    }

    public List<HttpParamItem> getReqParams()
    {
        return reqParams;
    }

    public void setReqParams(List<HttpParamItem> reqParams)
    {
        this.reqParams = reqParams;
    }
}
